package com.duowenlvshi.boot.domain;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author hbin
 * @date 2020-03-08 20:12
 */
@Document(indexName="springboot-restfull",type="user")
@Getter
@Setter
public class UserTemplate {

    public static final String INDEX_NAME = "springboot-restfull";
    public static final String TYPE_NAME = "user";
    @Id
    //@Field 每个文档的字段配置（类型、是否分词、是否存储、分词器 ）
    @Field(store=true, index = false,type = FieldType.Long)
    private String id;

    @Field(index=true,store=true,type = FieldType.Keyword)
    private String name;
    @Field(index=true,analyzer="ik_max_word",store=true,searchAnalyzer="ik_max_word",type = FieldType.Text)
    private String info;

}
